from turbogears import validators 
from turbogears import widgets as w

from form_validators import *


# widget lists 
class EventFields(w.WidgetsList):

    event_name = w.TextField(
        label=_(u'Event Name '),
        help_text=_(u'An event name is required.'))
    start_date = w.CalendarDateTimePicker(
        lable=_(u'Start Time '),
        help_text=_(u'A start date/time is required.'))
    end_date = w.CalendarDateTimePicker(
        lable=_(u'End Date '))
    description = w.TextArea(
        lable=_(u'Event Description'),
        help_text=_(u'A description of your event is required.'))
    home_page = w.TextField(
        label=_(u'Home Page: '),
        help_text=_(u'Please enter a valid URL.'))
         
           
class RegistrationFields(w.WidgetsList):

    user_name = w.TextField(
        label=_(u'User Name '))
    display_name = w.TextField(
        label=_(u'Display Name '))
    first_name = w.TextField(
        label=_(u'First Name '))
    last_name = w.TextField(
        label=_(u'Last Name '))
    email_address = w.TextField(
        label=_(u'Email '))
    password = w.PasswordField(
        label=_(u'Password '))
    confirm_password = w.PasswordField(
        label=_(u'Confirm Password '))
    

# forms
registration_form = w.TableForm(
    fields=RegistrationFields(),
    validator=RegistrationFormSchema(),
    name='w_registration_form',
    action='/save_registration',
    submit_text='Register')
    
event_form = w.TableForm(
    fields=EventFields(),
    validator=EventFormSchema(),
    name='w_event_form',
    action='/save_event',
    submit_text='Submit')